package com.bw.kotlindemo.java.model.net;


import org.jetbrains.annotations.NotNull;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
*desc: 请求头封装
*Create by xushaodong on 2023/2/4
*/
public class HeadInterceptor implements Interceptor {

    @NotNull
    @Override
    public Response intercept(@NotNull Chain chain) throws IOException {
            Request request = chain.request();
            Request newRequest = request.newBuilder()
                    .addHeader("userId", "111")
                    .addHeader("sessionId","1680504448878111")
                    .build();

            return chain.proceed(newRequest);
    }
}
